#ifndef _OPERATION_QUEUE_H
#define _OPERATION_QUEUE_H

namespace NetIO
{

class Operation_Queue
{
public:
	Operation_Queue (void);

public:

	~Operation_Queue (void);

	bool enqueue_operation (EventHandle handle, Operation *op);

	int has_operation (EventHandle handle);

	Operations *complete_queue ()
	{
		return completed_operations_;
	}

	int perform_operation (EventHandle handle);

	bool cancel_operation (EventHandle handle);

	void cancel_all_operation ();

	void collect_handle_to_set (Handle_Set & handle_set);

	void collect_connect_handle_to_set (Handle_Set & handle_set);

	void perform_operation_for_set (Handle_Set &handle_set);

private:

	typedef hash_map<EventHandle, Operation*> operation_map;

	Operations *completed_operations_;

	operation_map	operations_;
};

};
#endif


